var PageSizePlugin_ds = new Ext.data.SimpleStore({   
    fields: ['text', 'value'],   
    data: [['5', 5], ['10', 10], ['15', 15], ['20', 20], ['25', 25], ['50', 50], ['100', 100]]           
});

Ext.ux.PageSizePlugin = Ext.extend(Ext.form.ComboBox, {    
    store: PageSizePlugin_ds,           
    mode: 'local',           
    displayField: 'text',           
    valueField: 'value',           
    allowBlank: false,
    triggerAction: 'all',           
    width: 45,           
    maskRe: /[0-9]/  ,      
    beforeText:'每页'+'&nbsp;', 
    afterText: '&nbsp;'+'条', 
    init: function(paging) {           
         paging.on('render', this.onInitView, this);   
    },           
    onInitView: function(paging) {   
        paging.insert(paging.items.length-4,'-', this.beforeText, this, this.afterText);
        this.setValue(paging.pageSize);   

         this.on('select', this.onPageSizeChanged, paging);           
         this.on('specialkey', function(combo, e) {               
              if(13 === e.getKey()) {                   
                  this.onPageSizeChanged.call(paging, this);                       
              }           
          });       
     },       
     onPageSizeChanged: function(combo) {
         var old_pageSize = this.pageSize;
         this.pageSize = parseInt(combo.getRawValue(), 10);    
         if(this.pageSize <1 || this.pageSize >100) { 
        	 msgBox.alert('只能输入0-100的整数');
        	 this.pageSize = old_pageSize;
        	 return;
         }
         this.doLoad(0);       
     }
    
 }); 